<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%
    pageContext.setAttribute("path", request.getContextPath());
%>
<%  
    String path = request.getContextPath();  
    String basePath = request.getScheme() + "://"  
            + request.getServerName() + ":" + request.getServerPort()  
            + path + "/";  
%>  
<html>
<head>
<title>消息队列管理页面</title>
<link rel="stylesheet"
	href="//cdn.bootcss.com/bootstrap/3.3.5/css/bootstrap.min.css">
	<script type="text/javascript"	src="https://cdn.bootcss.com/jquery/3.3.1/jquery.min.js"></script>
<script	src="https://cdn.bootcss.com/bootstrap/4.1.0/js/bootstrap.min.js"></script>
<style type="text/css">
a {
    text-decoration: none;
    color: #fff;
    font-size: 14px;
}

h3 {
    width: 180px;
    height: 38px;
    margin: 50px auto;
    text-align: center;
    line-height: 38px;
    background: #5BC0DE;
    border-radius: 4px;
}
</style>
</head>
<body>
<div class="container">
		<!-- 标题 -->
		<div class="row">
			<div class="col-md-12">
				<h1>dubbo消息队列管理</h1>
			</div>
		</div>
		<!-- 按钮 -->
		<div class="row">
			<div class="col-md-4 col-md-offset-8">
				 <a class="btn btn-danger" href="${path}/login/go">返回</a> <a class="btn btn-danger" href="${path}/login/exit">退出</a><br/>
			</div>
		</div>
		<br/>
</div>


<div class="container">
	<div class="row  clearfix">
		<div class="col-md-6 column">
		    <h3> <a href="javascript:void()"  onclick="send()" >发送消息页面</a></h3>
		 <textarea rows="10" cols="60"> </textarea>  
		</div>
		<div class="col-md-6 column">
		    <h3><a href="javascript:void()" onclick="receive()">接收消息</a></h3>
		   <textarea rows="10" cols="60" > </textarea>
		</div>
	</div>
	
<script type="text/javascript">
	function send(){
		var url ="<%=basePath %>rocketmq/send";
		$.get(url,function(data,status){
		    alert("Data: " + data + "\nStatus: " + status);
		 });
		
	}
    function receive() {
    	var url ="<%=basePath %>rocketmq/receive";
    	$.get(url,function(data,status){
		    alert("Data: " + data + "\nStatus: " + status);
		 });
    }
</script>
</body>
</html>